<!-- This page asks students for the discipline they earned their degree
     in. They can choose from a list of disciplines. In the case that their
     discipline is not on the list, they can type in their discipline
     in a text box. 
     
     Upon clicking submit, they are led to More Degrees Page. -->

<%@page import="support.*, java.util.*, java.io.File"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="support.*, java.util.*, java.sql.*, javax.sql.*" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> 
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Provide Degrees -- Choose Discipline</title>
</head>
<body>

<CENTER>
<h1> Graduate School Application </h1>
<h2> Provide Degrees -- Choose Discipline Page </h2>
</CENTER>

<%
	support s = new support();   	
	String school = request.getParameter("school");
	session.setAttribute("school", school);
	String path3 = config.getServletContext().getRealPath("majors.txt");
	Vector majors = s.getMajors(path3);
%>

<!-- Display data collected from previous pages. -->
<b>First Name:</b> <bean:write name="studentsinfoform" property="first" />
<span style="padding-left:20px"><b>Middle Initial:</b> <bean:write name="studentsinfoform" property="middle" /></span>
<span style="padding-left:20px"><b>Last Name:</b>  <bean:write name="studentsinfoform" property="last" /> </span>
<p>
<b>Country of Citizenship:</b> <bean:write name="citizenshipform" property="citizen" /> <p>
<b>Country of Residence:</b> <bean:write name="residenceform" property="residence"/> <p>
<b>Country of Residency:</b> <bean:write name="residencyform" property="residency"/> <p>


<b>Address:</b><p>

	<logic:present name="addressform" property="street">
			<span style="padding-left:20px"><b>Street:</b> <bean:write name="addressform" property="street" /> <p></span>
	</logic:present>
	<logic:present name="addressform" property="city">
			<span style="padding-left:20px"><b>City:</b> <bean:write name="addressform" property="city" /> </span>
	</logic:present>	
	<logic:present name="addressform" property="lstate">
		<logic:notEqual  name="addressform" property="lstate" value="">
			<span style="padding-left:20px"><b>State:</b> <bean:write name="addressform" property="lstate" /> </span>
		</logic:notEqual>
	</logic:present>
	<logic:present name="addressform" property="zip">
		<logic:notEqual  name="addressform" property="zip" value="">
			<span style="padding-left:20px"><b>Zip Code:</b> <bean:write name="addressform" property="zip" /> </span>
		</logic:notEqual>
	</logic:present>
	
	<b>Phone Number:</b> (<bean:write name="addressform" property="areaCode" />) 
	                     (<bean:write name="addressform" property="pnumber" />) <p>


<logic:notEqual name="degreeform" property="count" value="first">
<logic:iterate id="degreeId" name="degreeform" property="degrees" >
==========================================================
<p><b>Location:</b> <bean:write name="degreeId" property="stuState"/></p>
<p><b>School:</b> <bean:write name="degreeId" property="school"/></p>
<p><b>Discipline of degree:</b> <bean:write name="degreeId" property="discp"/>
						 <bean:write name="degreeId" property="title"/></p>
<p><b>Degree earned in:</b> <bean:write name="degreeId" property="dmonth"/>
					 <bean:write name="degreeId" property="dyear"/></p>
<p><b>GPA: </b><bean:write name="degreeId" property="gpa"/></p>
</logic:iterate>
</logic:notEqual>

<!-- End of displaying collected information. -->


<br><b>Current Degree being added:</b><p>

<b>Location degree earned from:</b> <bean:write name="degreeform" property="stuState" /> <p>
<b>University degree earned from:</b> <bean:write name="degreeform" property="school" /> <p>

<!-- End of displaying collected information. -->

<br><b>Please specify the discipline you earned your degree in.</b> <p>
<b> **If you can't find your discipline in this list, please type your discipline
in the text box below.** </b>

<div style="color:red">
    <html:errors />
</div>
<html:form action="/degreeDiscp" enctype="multipart/form-data">
<% 
	for(int i=0; i<majors.size(); i++) 
	{

%>
	<html:radio name="degreeform" property="discp" value='<%=majors.get(i).toString()%>' /> <%=majors.get(i).toString()%> <br>
<%
	}
	
    out.println("<br>");
%>

Enter discipline: <html:text name = "degreeform" property="discp" size="20" /><p>
Degree Awarded or Expected:   
<p><span style="padding-left:20px">Month:<html:text name = "degreeform" property="dmonth" size="5" /></span>
Year:<html:text name = "degreeform" property="dyear" size="20" />

<!-- Drop down menu of the three titles (BS, MS, PhD) -->
<html:select name = "degreeform" property="title" >
	<html:option value="BS">BS</html:option>
	<html:option value="MS">MS</html:option>
	<html:option value="PHD">PHD</html:option>	
</html:select>
<p>

GPA (or Expected GPA): <html:text name = "degreeform" property="gpa" size="5" /><p>

<!-- Prompt the student to upload their transcript as a pdf file. -->
Please upload your transcript (file must be in pdf format):
Select File: 

	<html:file name = "degreeform" property="file" />

		<br />


<br><html:submit value="Proceed to More Degrees Page"/>
</html:form>

</body>
</html>